﻿@model IEnumerable<DAEProde.Domain.Tournament>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Administración de Torneos</h2>

<p>
    @Html.ActionLink("Nuevo Torneo", "Create")
</p>

<table>
    <tr>
        <th>
            Nombre Torneo
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model) {
        <tr>
            <td>
                @item.Name
            </td>
            <td>
                @Html.ActionLink("Editar", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Detalles", "Details", new { id = item.Id }) |
                @Html.ActionLink("Ver Fechas", "Index", "MatchDateManager", new { id = item.Id }, null) |
                @Html.ActionLink("Ver Equipos", "ViewTeams", new { id = item.Id }) |

                @using (Html.BeginForm("Delete", "TournamentManager", FormMethod.Post, new { style = "display:inline" }))
                {
                    @Html.AntiForgeryToken()
                    @Html.Hidden("id", item.Id)
                    <input type="submit" value="Borrar" />
                }
            </td>
        </tr>
    }
</table>
